package soccer.action;

import java.util.List;

import soccer.model.team.Team;
import soccer.model.team.TeamDAOImpl;

public class TeamActions {
  public int addNewTeam(int teamCode , String teamName ,String teamEstablishDate ,String teamCity){
	   Team team = new Team(teamCode, teamName, teamEstablishDate, teamCity);
       TeamDAOImpl teamDAO = new TeamDAOImpl();
       int rows = teamDAO.insertTeam(team);
       return rows;
   }
   public List searchTeamByName (String teamName){
	   List teamList = null;
	   TeamDAOImpl  teamDAO = new TeamDAOImpl();
	   teamList = teamDAO.searchTeamByName(teamName);
	   return teamList;
   }
   public List searchTeamByCity ( String teamCity){
	   List teamList = null;
	   TeamDAOImpl teamDAO = new TeamDAOImpl();
	   teamList = teamDAO.searchTeamByCity(teamCity);
	   return teamList;
   }
   public List getTeams(){
	   List teamList = null;
	   TeamDAOImpl teamDAO = new TeamDAOImpl();
	   teamList = teamDAO.getTeams();
	   return teamList;
   }
}
